package com.qingshu.common.entity.sys.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 用户信息查询
 * @author Huzz
 * @created 2021-12-07 14:24
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value="UserVO", description="用户信息查询")
public class UserVO {

    @ApiModelProperty(value = "用户id", example = "123")
    private Integer id;

    @ApiModelProperty(value = "用户昵称")
    private String nickname;

    @ApiModelProperty(value = "用户性别")
    private String sex;

    @ApiModelProperty(value = "出生年月")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date birth;

    @ApiModelProperty(value = "登录用户名")
    private String username;

    @ApiModelProperty(value = "创建人id", example = "123")
    private Integer createdUserId;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;

    @ApiModelProperty(value = "用户头像")
    private String headPortrait;

    @ApiModelProperty(value = "状态: 0禁用, 1启用", example = "123")
    private Integer status;

    @ApiModelProperty(value = "用户类型", example = "123")
    private Integer userType;

    @ApiModelProperty(value = "修改人id", example = "123")
    private Integer updateUserId;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    public UserVO(String nickname, String sex, Date birth, String username, Integer createdUserId, Integer status, Integer userType) {
        this.nickname = nickname;
        this.sex = sex;
        this.birth = birth;
        this.username = username;
        this.createdUserId = createdUserId;
        this.status = status;
        this.userType = userType;
    }
}
